﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using zielonka.co.uk.test.framework.time;

namespace zielonka.co.uk.extensions.system.tests
{
    [TestClass]
    public class AddYearsTests
    {
        [TestMethod]
        public void AddsIntYearsToADate()
        {
            DateTime expected = new PastClock().Now;
            expected=new DateTime(expected.Year+5,expected.Month,expected.Day,expected.Hour,expected.Minute,expected.Second,expected.Millisecond);

            DateTime pastDate = new PastClock().Now;
            var actual = pastDate.AddYears(5);
            Assert.AreEqual(expected ,actual);
        }

        [TestMethod]
        public void SubtractsANegativeIntYearsToADate()
        {
            var expected = new PastClock().Now;
            expected = new DateTime(expected.Year - 5, expected.Month, expected.Day, expected.Hour, expected.Minute, expected.Second, expected.Millisecond);

            DateTime pastDate = new PastClock().Now;
            var actual = pastDate.AddYears(-5);
            Assert.AreEqual(expected, actual);
        }
    }
}
